package com.zyw.zhuangdian.pojo.dto;

import com.zyw.zhuangdian.constant.ServiceConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户信息")
public class UserDto extends PageDto{
    @ApiModelProperty("主键id")
    private Long id;
    @ApiModelProperty("用户id 32")
    private String uid;
    @ApiModelProperty("用户登录名 30")
    private String username;
    @ApiModelProperty("用户昵称 20")
    private String nickname;
    @ApiModelProperty("加密后的密码 64")
    private String password;
    @ApiModelProperty("加密用的盐 32")
    private String salt;
    @ApiModelProperty("头像文件名 40")
    private String avatar;

    @ApiModelProperty("生日")
    private Date birthday;
    @ApiModelProperty("性别 0男 1女")
    private String gender;
    @ApiModelProperty("邮箱 40")
    private String email;
    @ApiModelProperty("手机号 20")
    private String phone;

    @ApiModelProperty("token 250")
    private String token;
    @ApiModelProperty("个性签名 50")
    private String description;
    @ApiModelProperty("用户肤质 30")
    private String skinType;

    @ApiModelProperty("用户权限 0 禁用 1 普通 2 超管 3 admin")
    private Integer privilege = ServiceConstant.PRIVILEGE_NORMAL;
    @ApiModelProperty("记录状态 0 失效 1 有效")
    private int status = ServiceConstant.STATUS_VALID;
    @ApiModelProperty("创建时间")
    private Date createTime;

    public void harmless(){
        this.password = null;
        this.salt = null;
    }

}
